The tree component displays hierarchical data as a "tree" of branches and leaf nodes. Optionally, the tree may also display navigation controls for the dynamic expansion and collapse of branch nodes. Nodes may also support an action event when clicked that can be used to respond to user click events.
The tree component uses a TreeModel defined in an application backing bean. The TreeModel must contain a tree of DefaultMutableTreeNode instances. Each DefaultMutableTreeNode instance encapsultes an IceUserObject. The IceUserObject is the extension point for the application developer. The leaf attribute of the IceUserObject defines the type of the tree node. By default the leaf attribute is false and tree nodes will be folders unless the leaf attribute is set to true.
The tree component can be used in cases where a
hierarchical
data structure must be viewed and navigated. It is typically used for
menu-style applications, where the user selects a tree node and the
application responds with an action related to the selected node.
The following code shows how to create a basic tree component:
<ice:tree
id="myTree"
value="#{treeBean.model}"
hideRootNode="false"
action="#{treeBean.treeSelectionAction}"
binding="#{treeBean.treeComponent}"
/>
|
tag-name:
|
<ice:tree>
|
|
tag-class:
|
com.icesoft.faces.component.tree.TreeTag
|
|
component-class:
|
com.icesoft.faces.component.tree.Tree
|
|
component-type:
|
com.icesoft.faces.TreeView
|
|
component-family:
|
com.icesoft.faces.TreeView
|
|
renderer-class:
|
com.icesoft.faces.component.tree.TreeRenderer
|
|
renderer-type:
|
com.icesoft.faces.View
|